package cn.gzjp.modules.logis.entity;

import cn.gzjp.common.config.ConfigUtils;
import cn.gzjp.common.utils.StringUtils;
import org.hibernate.validator.constraints.Length;

import cn.gzjp.common.persistence.DataEntity;
import cn.gzjp.common.utils.excel.annotation.ExcelField;

/**
 * 货物图片Entity
 * @author zengcp
 * @version 2018-03-21
 */
public class LogisGoodsPic extends DataEntity<LogisGoodsPic> {
	
	private static final long serialVersionUID = 1L;
	private String deliveryId;		// 发货id
	private String path;		// 文件存放路径
	
	public LogisGoodsPic() {
		super();
	}

	public LogisGoodsPic(String id){
		super(id);
	}

	public String getDeliveryId() {
		return deliveryId;
	}

	public void setDeliveryId(String deliveryId) {
		this.deliveryId = deliveryId;
	}
	
	public String getPath() {
		return path;
	}

	public void setPath(String path) {
		this.path = path;
	}

	public String getPicUrl() {
		if (StringUtils.isNotBlank(path)) {
			if(path.startsWith("http")){
				return path;
			}else{
				String photoUrl = ConfigUtils.getProperty("photoUrl");
				return photoUrl + path;
			}
		}
		return "";
	}
	
}